﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Peekaboo2008.dao;
using Peekaboo2008.common;
using Peekaboo2008.model;
using Peekaboo2008.controls;
using System.Collections;

namespace Peekaboo2008.view
{
    public partial class FormPhieuHangChiTiet : Form
    {
        private String MaSoPhieuHang = "";
        private DataTable dbDanhSachHangHoa;
        public FormPhieuHangChiTiet(String _MaSoPhieuHang)
        {
            this.MaSoPhieuHang = _MaSoPhieuHang;
            InitializeComponent();
            initDanhSachHangHoa();
        }
        public FormPhieuHangChiTiet()
        {
            InitializeComponent();
            initDanhSachHangHoa();
        }

        private void initDanhSachHangHoa()
        {
            dbDanhSachHangHoa = ChiTietNhapXuatDAO.getByMaPhieuNhapXuat(MaSoPhieuHang);
            grvDanhSachHangHoa.DataSource = dbDanhSachHangHoa;
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void FormPhieuHangChiTiet_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.F7:
                    this.Dispose();
                    break;
            }
        }
    }
}
